/*************************************************
 Copyright (c) 2017 
 Copyright (c) 2017 bruce <3350207067@qq.com>

 Author:    bruce
 Version:   1.0
 Date:      2017-10-19
 Description:
 
 ************************************************/
 

#ifndef FF_TYPEDEF_H
#define FF_TYPEDEF_H

/* ERROR CODE */
#define ERROR_BUFFERING_TIMEOUT 100
#define OK 0
#define ERROR -1


/* off network timeout function */
#define BUFFERING_TIMEOUT 10*1000
#define NET_TIMEOUT 1000

/* subtitle function */
#define SUBTITLE_BUFFER_SIZE 512*1024
#define HTTP_REQUEST_SIZI 256
#define SUBTITLE_WAIT_TIMEOUT 15*1000
#define SUBTITLE_WAIT_UNIT 100

#define ENCRYPT 0
#define DECRYPT 1
#define ECB 0
#define CBC 1
#define KEY_LEN_8 8
#define KEY_LEN_16 16
#define KEY_LEN_24 24
#define PAD_ISO_1   0
#define PAD_ISO_2   1
#define PAD_PKCS_7  2

/* offline buffering function */
#define READ_BUFFER_SIZE 32*1024
#define ENCRYPT_LENGTH 32*1024
#define ENCRYPT_SWAP_HIGH_NUMBER 2
#define ENCRYPT_FLAG_LENGTH 8
#define ENCRYPT_FLAG "KOOCAN01"

#define TEST_ORIGIN 1

typedef char (*PSubKey)[16][48];

#define SUBTITLE_TEST 0
#define SWITCH_SUB 0


#define PRINT_LOG(DBG_SWITCH, ...)  do{\
if (DBG_SWITCH)\
    MPTRACE(__VA_ARGS__);\
}while(0);
    
#define DBG_SUBTITLE(...) PRINT_LOG(SWITCH_SUB, __VA_ARGS__)


#endif
